import request from '@/utils/request.js'

// 模型列表
export const getModelList = () => {
  return request({
    url: '/model/list',
    method: 'GET',
  })
}

// 模型详情
export const getModelDetail = (data) => {
  return request({
    url: `/model/getById`,
    method: 'POST',
    data
  })
}

// 模型创建
export const createModel = (data) => {
  return request({
    url: '/model/create',
    method: 'POST',
    data,
  })
}

// 模型更新
export const updateModel = (data) => {
  return request({
    url: `/model/updateById`,
    method: 'POST',
    data,
  })
}

// 上传检测目标图片
export const uploadTargetImage = (data) => {
  return request({
    url: '/model/picUpload',
    method: 'POST',
    data,
  })
}

//上传模型文件
export const uploadModelFile= (data) => {
  return request({
    url: '/model/modelUpload',
    method: 'POST',
    data,
  })
}


// 获取图片路径
export const getImageUrl = (data) => {
  return request({
    url: `/showFiles/show`,
    method: 'POST',
    data
  })
}


// 删除图片或模型文件
export const deleteImageOrModelFile = (data) => {
  return request({
    url: '/model/deleteFileByUrl',
    method: 'POST',
    data,
  })
}


